From: Florian Müllner Date: Sun, 17 Aug 2014 17:44:52 +0000 (+0200) Subject: iconGrid: Move code around a bit X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2235 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=9c008ab998614c64d6711b1e5bcf2db30d33b1cc;p=gnome-shell.git iconGrid: Move code around a bit The scale passed to _updateChildrenScale is exclusively computed from properties, so it can be moved into the function itself - as the scale now becomes a mere detail, rename to a more appropriate _updateIconSizes at the same time. --- diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js index 9cf9f2f78..4c555acce 100644 --- a/js/ui/iconGrid.js +++ b/js/ui/iconGrid.js @@ -524,12 +524,13 @@ const IconGrid = new Lang.Class({ this._updateSpacingForSize(availWidth, availHeight); } - let scale = Math.min(this._fixedHItemSize, this._fixedVItemSize) / Math.max(this._hItemSize, this._vItemSize); - Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this, function() { this._updateChildrenScale(scale); })); + Meta.later_add(Meta.LaterType.BEFORE_REDRAW, + Lang.bind(this, this._updateIconSizes)); }, // Note that this is ICON_SIZE as used by BaseIcon, not elsewhere in IconGrid; it's a bit messed up - _updateChildrenScale: function(scale) { + _updateIconSizes: function() { + let scale = Math.min(this._fixedHItemSize, this._fixedVItemSize) / Math.max(this._hItemSize, this._vItemSize); let newIconSize = Math.floor(ICON_SIZE * scale); for (let i in this._items) { this._items[i].icon.setIconSize(newIconSize);